package blockchain

import (
	"context"

	"private-domain-overseas-service/admin/business/api/internal/svc"
	"private-domain-overseas-service/tools/ent"
	"private-domain-overseas-service/tools/ent/hzblockchainwallet"
)

type BlockchainWalletDao struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

func NewBlockchainWalletDao(ctx context.Context, svcCtx *svc.ServiceContext) *BlockchainWalletDao {
	return &BlockchainWalletDao{
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (d *BlockchainWalletDao) GetWalletByID(walletID int64) (*ent.HzBlockchainWallet, error) {
	return d.svcCtx.Orm.HzBlockchainWallet.Query().
		Where(hzblockchainwallet.ID(int(walletID))).
		First(d.ctx)
}
